package com.k8.rpc.serialize;

import com.k8.common.annotation.SPI;
import com.k8.rpc.invoke.invocation.Invocation;
import io.netty.buffer.ByteBuf;

import java.lang.reflect.Method;

/**
 * @Author: k8
 * @CreateTime: 2025-03-26
 * @Version: 1.0
 */
@SPI
public interface Serializer {
    String serializerName();

    <T> T decode(ByteBuf byteBuf, Class<T> clazz);

    //todo 还需要由encode
    <T> ByteBuf encode(T object, ByteBuf byteBuf);

    <T> ByteBuf encode(T object);
}
